
package edu.tongji.jiaowu.dao.jdbc;
 
import java.util.List;

import edu.tongji.jiaowu.dao.EnrollmentChangeDao;
import com.tongji.quickCRUDQ.define.Row;
import com.tongji.quickCRUDQ.model.CommonBean;
import com.tongji.quickCRUDQ.dao.jdbc.BaseDaoJdbc;

public class EnrollmentChangeDaoJdbc extends BaseDaoJdbc implements EnrollmentChangeDao {
	String tableName="T_ENROLLMENT_CHANGE";
	String beanName="enrollmentChange";
	
	public CommonBean createEnrollmentChange(){
		CommonBean enrollmentChanges=this.createBean(tableName,beanName);
                return enrollmentChanges;		
	}
	
/*
	public CommonBean findEnrollmentChanges(String refid) {
		CommonBean enrollmentChanges=this.createEnrollmentChange();
		String sql="select * from T_ENROLLMENT_CHANGE where refid=?";
		List data=this.getCommonDao().select(sql,new String[]{refid});
		enrollmentChanges.addData(data);
                return enrollmentChanges;
       }
*/
	public CommonBean findEnrollmentChangeById(String id) {
		CommonBean enrollmentChanges=this.createEnrollmentChange();
		String sql="select * from T_ENROLLMENT_CHANGE where id=?";
		List data=this.getCommonDao().select(sql,new String[]{id});
		enrollmentChanges.addData(data);
    return enrollmentChanges;
  }
  
	public CommonBean findAllEnrollmentChanges() {
		CommonBean enrollmentChanges=this.createEnrollmentChange();
		String sql="select * from T_ENROLLMENT_CHANGE ";
		List data=this.getCommonDao().select(sql,new String[]{});
		enrollmentChanges.addData(data);
    return enrollmentChanges;
  }
	public void insertEnrollmentChange(CommonBean enrollmentChangeBean){
		List data=enrollmentChangeBean.getData();
		Row row=this.getRow(tableName);
		this.getCommonDao().templateBatchInsert(row,data,this.getIdGenerator());
	}
	public void updateEnrollmentChange(CommonBean enrollmentChangeBean){
		List data=enrollmentChangeBean.getData();
		Row row=this.getRow(tableName);
		this.getCommonDao().templateBatchUpdate(row,data);
	}
}

